<?php
class exam extends IController
{
    public function regis()
    {
        $this->redirect("regis");
    }
    public function act()
    {
        $id=$_GET['id'];
        $id=base64_decode($id);
        $arr=array('status'=>1);
        $model=new IModel("yx");
        $model->setData($arr);
        $res=$model->update("id=$id");
        if($res)
        {
            $this->redirect("login");
        }
    }
    public  function register()
    {
        $name=IReq::get("name");
        $pwd=IReq::get("pwd");
        $email=$_POST['email'];
        $arr=array('name'=>$name,'pwd'=>$pwd,'email'=>$email,'status'=>0);
        $model=new IModel("yx");
        $model->setData($arr);
        $res=$model->add();
        if($res)
        {
            $title="欢迎注册成为我们网站会员";
            $url="http://www.iwebshop.com/index.php/exam/act/id/".base64_encode($res);
            $content="请点击此链接激活".$url;
            $mail=new SendMail();
            $mail->send($email,$title,$content);
        }
    }
}


?>